home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Code Resources / 3D Buttons CDEF 1.0b4 / Source / 3D Buttons CDEF source / (3D Buttons CDEF.π) / UGBDraw.h < prev   
Encoding:
C/C++ Source or Header  |  1994-07-31  |  2.6 KB  |  80 lines  |  [TEXT/MMCC]

  1. /**************************************************************************
  2.     UGBDraw
  3.     
  4.     Public domain, by Zig Zichterman.
  5.     
  6.     Utility functions for drawing in color. All these functions assume
  7.     color quickdraw.
  8.     
  9.     This class implements 3D drawing according to the guidelines
  10.     suggested in _develop_ 15. Some of the drawing code is taken from
  11.     the public domain source accompanying _develop_ 15.
  12.  
  13.     07/31/94    zz    add ColorQDIsPresent()
  14.     07/28/94    zz    add offscreen drawing stuff
  15. **************************************************************************/
  16. #pragma once
  17.  
  18. #include <QDOffscreen.h>
  19.  
  20. const short    UGBDraw_greyF        = 0xFFFF;    // 65535
  21. const short    UGBDraw_greyE        = 0xEEEE;    // 61166
  22. const short UGBDraw_greyD        = 0xDDDD;    // 56797
  23. const short    UGBDraw_greyC        = 0xCCCC;    // 52428
  24. const short    UGBDraw_greyB        = 0xBBBB;    // 48059
  25. const short    UGBDraw_greyA        = 0xAAAA;    // 43690
  26. const short    UGBDraw_grey9        = 0x9999;    // 39321
  27. const short    UGBDraw_grey8        = 0x8888;    // 34952
  28. const short    UGBDraw_grey7        = 0x7777;    // 30583
  29. const short    UGBDraw_grey6        = 0x6666;    // 26214
  30. const short    UGBDraw_grey5        = 0x5555;    // 21845
  31. const short    UGBDraw_grey4        = 0x4444;    // 17476
  32. const short    UGBDraw_grey3        = 0x3333;    // 13107
  33. const short    UGBDraw_grey2        = 0x2222;    //  8738
  34. const short    UGBDraw_grey1        = 0x1111;    //  4369
  35. const short    UGBDraw_grey0        = 0x0000;    //     0
  36.  
  37. const short    UGBDraw_white        = UGBDraw_greyF;
  38. const short    UGBDraw_black        = UGBDraw_grey0;
  39. const short UGBDraw_background    = UGBDraw_greyD;
  40. const short    UGBDraw_hiliteBackground    = UGBDraw_grey8;
  41.  
  42. const short    UGBDraw_3DLight        = UGBDraw_greyF;
  43. const short    UGBDraw_3DDark        = UGBDraw_greyB;
  44.  
  45. const short UGBDraw_DimText        = UGBDraw_grey8;    // was A
  46.  
  47. // ### accent colors not implemented yet
  48. const short    UGBDraw_AccentLight    = UGBDraw_greyC;
  49. const short    UGBDraw_AccentDark    = UGBDraw_grey7;
  50.  
  51.  
  52. /**************************************************************************
  53.     class UGBDraw
  54. **************************************************************************/
  55. class UGBDraw {
  56.     public :
  57.         static void    PenNormal(void);
  58.         static void    PenReallyNormal(void);
  59.         static void    Background(void)        { BackGrey(UGBDraw_background); }
  60.         static void    PenFrameInactive(void)    { ForeGrey(UGBDraw_DimText); }
  61.         static void    PenFrameActive(void)    { ForeGrey(UGBDraw_black); }
  62.         
  63.         static void    ForeGrey(unsigned short inGrey);
  64.         static void    BackGrey(unsigned short inGrey);
  65.         
  66.         struct Offscreen {
  67.             CGrafPtr    savePort;
  68.             GDHandle    saveDevice;
  69.             Rect        gbounds;            // global bounds
  70.             Rect        lbounds;            // bounds local to the *screen* port
  71.             GWorldPtr    gworld;
  72.         };
  73.         static void    OffscreenPre(Offscreen &outOffscreen);
  74.         static void    OffscreenPost(Offscreen &ioOffscreen);
  75.         
  76.         static Boolean    ColorQDIsPresent(void);
  77. };
  78.  
  79.  
  80.